// V = 4.0/3.0 * M_PI * pow(radius * 3)

#include <iostream>
#include <math.h>

int main() {
    using std::cout;
    cout << "\n两种球体体积计算方法\n半径为1的球体体积为4.18879";

    double radius = 1.0;
    double volumeOK = 4.0/3.0 * M_PI * pow(radius, 3);
    double volumeNG = 4/3 * M_PI * radius * radius * radius;

    cout << "\n\n正确编码 4.0/3.0 ==> 体积 = " << volumeOK;
    cout << "\n\n错误编码 4/3 ==> 体积 = " << volumeNG;

    cout << "\n\n哇塞，稍不留神，就会出错!";
}

// g++ -fexec-charset=GBK ch02/2_8.cpp && ./a